import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;


public class MyRunnable implements  Runnable {

	int start;
	int end;
	List<Integer> integers;
	
	public MyRunnable(List<Integer> integers,int start, int end) {
		super();
		this.integers=integers;
		this.start = start;
		this.end = end;
	}

	@Override
	public void run() {
		List<Integer> subints=integers.subList(start, end);
		//处理
	}
	public static void main(String[] args) {
		List<Integer> integers=new ArrayList<Integer>();
	     for (int i = 0; i < 60; i++) {integers.add(i);}
	     ExecutorService executorService=Executors.newFixedThreadPool(3);
	     executorService.submit(new MyRunnable(integers,0,20));
	     executorService.submit(new MyRunnable(integers,20,40));
	     executorService.submit(new MyRunnable(integers,40,60));
	     
	     executorService.shutdown();
		
	}
	
	
}
